[Xamarin.Android.Build.Tasks] Fix an issue where the 'ref' nuget is not found on windows. - #1474
Merged
Merged
Conversation
…ot found on windows. The previous commit 029a8b4 fixed up some issues with resolving the correct nuget. However on windows we get some weird pathing issues because the project.assets.json file is using `/` as path seperators. This is probably to be platform independent. But our string comparision was using what ever path we had, on windows that was `\`. So we never found the Library were we looking for. We also need to normalize the resulting full path to match the system path separator.
Member
|
I'm starting a Windows PR build for this one |
jonpryor
pushed a commit
that referenced
this pull request
Mar 27, 2018
The previous commit 029a8b4 fixed up some issues with resolving the correct nuget. However on windows we get some weird pathing issues because the project.assets.json file is using `/` as path seperators. This is probably to be platform independent. So in the project.assets.json we have a PackageName of System.IO.Packaging/4.4.0 note the use of the `/`. But our string comparision was using what ever path we had, on windows that was `\`: c:\pathtonuget\system.io.packaging\4.4.0\ref\netstandard1.3\System.IO.Packaging.dll So we never found the Library were we looking for because `system.io.packaging/4.4.0` != `system.io.packaging\4.4.0`. We just got lucky that it worked on Mac because the path separator is `/`. We also need to normalize the resulting full path to match the system path separator, otherwise we end up looking for files like c:\pathtonuget\system.io.packaging/4.4.0\lib\netstandard1.3/System.IO.Packaging.dll which do not work.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous commit 029a8b4 fixed up some issues with resolving
the correct nuget. However on windows we get some weird pathing
issues because the project.assets.json file is using
/aspath seperators. This is probably to be platform independent.
So in the project.assets.json we have a PackageName of
System.IO.Packaging/4.4.0note the use of the
/.But our string comparision was using what ever path we had, on
windows that was
\.c:\pathtonuget\system.io.packaging\4.4.0\ref\netstandard1.3\System.IO.Packaging.dllSo we never found the Library were we
looking for because
system.io.packaging/4.4.0!=system.io.packaging\4.4.0.We just got lucky that it worked on Mac because the path separator is
/.We also need to normalize the resulting full path
to match the system path separator, otherwise we end up looking for files like
c:\pathtonuget\system.io.packaging/4.4.0\lib\netstandard1.3/System.IO.Packaging.dllwhich do not work.